/**
 * 名称：设置模型离地高度
 * 作用：通过传入的高度与，3D Tiles数据对对应的3Dtile数据进行高度的调整
 * 参数：height：15, tileset：{....}
 * height：模型离地高度，
 * tileset:创建3Dtile时候的变量
 * 状态：
 * 网址：https://sandcastle.cesium.com/?src=3D%20Tiles%20Adjust%20Height.html&label=3D%20Tiles
 * 负责人：
 */
function setModelHeight(height, tileset) {
    height = Number(height);
    if (isNaN(height) || !Cesium.defined(tileset)) {
        return;
    }

    const cartographic = Cesium.Cartographic.fromCartesian(
        tileset.boundingSphere.center
    );
    const surface = Cesium.Cartesian3.fromRadians(
        cartographic.longitude,
        cartographic.latitude,
        0.0
    );
    const offset = Cesium.Cartesian3.fromRadians(
        cartographic.longitude,
        cartographic.latitude,
        height
    );
    const translation = Cesium.Cartesian3.subtract(
        offset,
        surface,
        new Cesium.Cartesian3()
    );
    tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation)
}
